<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
      <title>GTL - Graph Template Library: maxflow_pp.h Source File</title>
      <link href="doxygen.css" rel="stylesheet" type="text/css">
  </head>
  <body>
    <p class="links">  
      <a href="../index.html">Home</a> |
      Documentation |
      <a href="../register.html">Download</a> |
      <a href="../platforms.html">Platforms</a> |
      <a href="../refer.html">Projects</a> |      
      <a href="../lists.html">Mailing Lists</a> |
      <a href="../history.html">Version History</a>
    </p>

<!-- Generated by Doxygen 1.5.3 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="classes.html"><span>Classes</span></a></li>
    <li class="current"><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul>
</div>
<h1>maxflow_pp.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">//==========================================================================</span>
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">//   maxflow_pp.h</span>
<a name="l00004"></a>00004 <span class="comment">//</span>
<a name="l00005"></a>00005 <span class="comment">//==========================================================================</span>
<a name="l00006"></a>00006 <span class="comment">// $Id: maxflow_pp.h,v 1.5 2003/01/31 08:15:05 chris Exp $</span>
<a name="l00007"></a>00007 
<a name="l00008"></a>00008 <span class="preprocessor">#ifndef GTL_MAXFLOW_PP_H</span>
<a name="l00009"></a>00009 <span class="preprocessor"></span><span class="preprocessor">#define GTL_MAXFLOW_PP_H</span>
<a name="l00010"></a>00010 <span class="preprocessor"></span>
<a name="l00011"></a>00011 <span class="preprocessor">#include &lt;GTL/GTL.h&gt;</span>
<a name="l00012"></a>00012 <span class="preprocessor">#include &lt;GTL/graph.h&gt;</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;GTL/node_map.h&gt;</span>
<a name="l00014"></a>00014 <span class="preprocessor">#include &lt;GTL/edge_map.h&gt;</span>
<a name="l00015"></a>00015 <span class="preprocessor">#include &lt;GTL/algorithm.h&gt;</span>
<a name="l00016"></a>00016 
<a name="l00017"></a>00017 <span class="preprocessor">#include &lt;queue&gt;</span>
<a name="l00018"></a>00018 
<a name="l00019"></a>00019 __GTL_BEGIN_NAMESPACE
<a name="l00020"></a>00020 
<a name="l00024"></a><a class="code" href="a00016.html">00024</a> <span class="keyword">class </span>GTL_EXTERN <a class="code" href="a00016.html" title="Maximum flow algorithm (Malhotra, Kumar, Maheshwari).">maxflow_pp</a> : <span class="keyword">public</span> <a class="code" href="a00001.html" title="Abstract baseclass for all algoritm-classes.">algorithm</a>
<a name="l00025"></a>00025 {
<a name="l00026"></a>00026 <span class="keyword">public</span>:
<a name="l00033"></a>00033     <a class="code" href="a00016.html" title="Maximum flow algorithm (Malhotra, Kumar, Maheshwari).">maxflow_pp</a>();
<a name="l00034"></a>00034 
<a name="l00040"></a>00040     <span class="keyword">virtual</span> ~<a class="code" href="a00016.html" title="Maximum flow algorithm (Malhotra, Kumar, Maheshwari).">maxflow_pp</a>();
<a name="l00041"></a>00041 
<a name="l00049"></a>00049     <span class="keywordtype">void</span> set_vars(<span class="keyword">const</span> <a class="code" href="a00011.html" title="A specialized map with edges as keys.">edge_map&lt;double&gt;</a>&amp; edge_capacity);
<a name="l00050"></a>00050 
<a name="l00058"></a>00058     <span class="keywordtype">void</span> set_vars(
<a name="l00059"></a>00059         <span class="keyword">const</span> <a class="code" href="a00011.html" title="A specialized map with edges as keys.">edge_map&lt;double&gt;</a>&amp; edge_capacity, 
<a name="l00060"></a>00060         <span class="keyword">const</span> <a class="code" href="a00020.html" title="A node in a graph.">node</a>&amp; net_source, <span class="keyword">const</span> <a class="code" href="a00020.html" title="A node in a graph.">node</a>&amp; net_target);
<a name="l00061"></a>00061 
<a name="l00080"></a>00080     <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="a00001.html#76361fb03ad1cf643affc51821e43bed" title="Checks whether all preconditions are satisfied.">check</a>(<a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp; G);
<a name="l00081"></a>00081 
<a name="l00090"></a>00090     <span class="keywordtype">int</span> <a class="code" href="a00001.html#734b189509a8d6b56b65f8ff772d43ca" title="Applies algorithm to graph g.">run</a>(<a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp; G);
<a name="l00091"></a>00091 
<a name="l00098"></a>00098     <span class="keywordtype">double</span> get_max_flow(<span class="keyword">const</span> <a class="code" href="a00010.html" title="An edge in a graph.">edge</a>&amp; e) <span class="keyword">const</span>;
<a name="l00099"></a>00099 
<a name="l00105"></a>00105     <span class="keywordtype">double</span> get_max_flow() <span class="keyword">const</span>;
<a name="l00106"></a>00106 
<a name="l00113"></a>00113     <span class="keywordtype">double</span> get_rem_cap(<span class="keyword">const</span> <a class="code" href="a00010.html" title="An edge in a graph.">edge</a>&amp; e) <span class="keyword">const</span>;
<a name="l00114"></a>00114 
<a name="l00120"></a>00120     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a00001.html#21aba63d066ae7897de6ca7d8425c408" title="Resets algorithm.">reset</a>();
<a name="l00121"></a>00121 <span class="keyword">protected</span>:
<a name="l00125"></a>00125     <span class="keyword">enum</span> {TARGET_FROM_SOURCE_REACHABLE = 2, TARGET_FROM_SOURCE_NOT_REACHABLE = 3};
<a name="l00126"></a>00126 
<a name="l00130"></a>00130     <span class="keywordtype">bool</span> artif_source_target;
<a name="l00131"></a>00131 
<a name="l00135"></a>00135     <span class="keywordtype">bool</span> set_vars_executed;
<a name="l00136"></a>00136 
<a name="l00140"></a>00140     <span class="keywordtype">double</span> max_graph_flow;
<a name="l00141"></a>00141 
<a name="l00145"></a>00145     <a class="code" href="a00020.html" title="A node in a graph.">node</a> net_source;
<a name="l00146"></a>00146 
<a name="l00150"></a>00150     <a class="code" href="a00020.html" title="A node in a graph.">node</a> net_target;
<a name="l00151"></a>00151 
<a name="l00155"></a>00155     list&lt;edge&gt; edges_not_org;
<a name="l00156"></a>00156 
<a name="l00160"></a>00160     <a class="code" href="a00011.html" title="A specialized map with edges as keys.">edge_map&lt;bool&gt;</a> edge_org;
<a name="l00161"></a>00161 
<a name="l00165"></a>00165     <a class="code" href="a00011.html" title="A specialized map with edges as keys.">edge_map&lt;bool&gt;</a> back_edge_exists;
<a name="l00166"></a>00166 
<a name="l00170"></a>00170     <a class="code" href="a00011.html" title="A specialized map with edges as keys.">edge_map&lt;edge&gt;</a> back_edge;
<a name="l00171"></a>00171 
<a name="l00175"></a>00175     <a class="code" href="a00011.html" title="A specialized map with edges as keys.">edge_map&lt;double&gt;</a> edge_capacity;
<a name="l00176"></a>00176 
<a name="l00180"></a>00180     <a class="code" href="a00011.html" title="A specialized map with edges as keys.">edge_map&lt;double&gt;</a> edge_max_flow;
<a name="l00181"></a>00181 
<a name="l00185"></a>00185     <a class="code" href="a00011.html" title="A specialized map with edges as keys.">edge_map&lt;double&gt;</a> flow_update;
<a name="l00186"></a>00186 
<a name="l00190"></a>00190     list&lt;edge&gt; full_edges;
<a name="l00191"></a>00191                 
<a name="l00195"></a>00195     list&lt;node&gt; temp_unvisible_nodes;
<a name="l00196"></a>00196                 
<a name="l00200"></a>00200     list&lt;edge&gt; temp_unvisible_edges;
<a name="l00201"></a>00201                 
<a name="l00205"></a>00205     <span class="keywordtype">void</span> create_artif_source_target(<a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp; G);
<a name="l00206"></a>00206 
<a name="l00210"></a>00210     <span class="keywordtype">void</span> prepare_run(<span class="keyword">const</span> <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp; G);
<a name="l00211"></a>00211 
<a name="l00215"></a>00215     <span class="keywordtype">int</span> leveling(<a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp; G);
<a name="l00216"></a>00216 
<a name="l00220"></a>00220     <span class="keywordtype">void</span> hide_unreachable_nodes(<a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp; G);
<a name="l00221"></a>00221 
<a name="l00225"></a>00225     <span class="keywordtype">void</span> store_temp_unvisible_edges(<span class="keyword">const</span> <a class="code" href="a00020.html" title="A node in a graph.">node</a>&amp; cur_node);
<a name="l00226"></a>00226 
<a name="l00230"></a>00230     <span class="keywordtype">void</span> min_throughput_node(<span class="keyword">const</span> <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp; G, <a class="code" href="a00020.html" title="A node in a graph.">node</a>&amp; min_tp_node, <span class="keywordtype">double</span>&amp; min_value);
<a name="l00231"></a>00231 
<a name="l00235"></a>00235     <span class="keywordtype">double</span> comp_min_throughput(<span class="keyword">const</span> <a class="code" href="a00020.html" title="A node in a graph.">node</a> cur_node) <span class="keyword">const</span>;
<a name="l00236"></a>00236 
<a name="l00240"></a>00240     <span class="keywordtype">void</span> get_sp_ahead(<span class="keyword">const</span> <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp; G, <span class="keyword">const</span> <a class="code" href="a00020.html" title="A node in a graph.">node</a>&amp; start_node, 
<a name="l00241"></a>00241         <a class="code" href="a00021.html" title="A specialized map with nodes as keys.">node_map&lt;edge&gt;</a>&amp; last_edge);
<a name="l00242"></a>00242 
<a name="l00246"></a>00246     <span class="keywordtype">void</span> get_sp_backwards(<span class="keyword">const</span> <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp; G, <span class="keyword">const</span> <a class="code" href="a00020.html" title="A node in a graph.">node</a>&amp; start_node, 
<a name="l00247"></a>00247         <a class="code" href="a00021.html" title="A specialized map with nodes as keys.">node_map&lt;edge&gt;</a>&amp; prev_edge);
<a name="l00248"></a>00248 
<a name="l00252"></a>00252     <span class="keywordtype">void</span> push(<a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp; G, <span class="keyword">const</span> <a class="code" href="a00020.html" title="A node in a graph.">node</a>&amp; start_node, <span class="keyword">const</span> <span class="keywordtype">double</span> flow_value);
<a name="l00253"></a>00253 
<a name="l00257"></a>00257     <span class="keywordtype">void</span> pull(<a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp; G, <span class="keyword">const</span> <a class="code" href="a00020.html" title="A node in a graph.">node</a>&amp; start_node, <span class="keyword">const</span> <span class="keywordtype">double</span> flow_value);
<a name="l00258"></a>00258 
<a name="l00262"></a>00262     <span class="keywordtype">void</span> comp_rem_net(<a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp; G);
<a name="l00263"></a>00263 
<a name="l00267"></a>00267     <span class="keywordtype">void</span> single_edge_update(<a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp; G, <a class="code" href="a00010.html" title="An edge in a graph.">edge</a> cur_edge);
<a name="l00268"></a>00268 
<a name="l00272"></a>00272     <span class="keywordtype">double</span> extra_charge_ahead(<span class="keyword">const</span> <a class="code" href="a00020.html" title="A node in a graph.">node</a>&amp; start_node, <span class="keyword">const</span> 
<a name="l00273"></a>00273         <a class="code" href="a00021.html" title="A specialized map with nodes as keys.">node_map&lt;edge&gt;</a>&amp; last_edge) <span class="keyword">const</span>;
<a name="l00274"></a>00274 
<a name="l00278"></a>00278     <span class="keywordtype">double</span> extra_charge_backwards(<span class="keyword">const</span> <a class="code" href="a00020.html" title="A node in a graph.">node</a>&amp; start_node, 
<a name="l00279"></a>00279         <span class="keyword">const</span> <a class="code" href="a00021.html" title="A specialized map with nodes as keys.">node_map&lt;edge&gt;</a>&amp; prev_edge) <span class="keyword">const</span>;
<a name="l00280"></a>00280 
<a name="l00284"></a>00284     <span class="keywordtype">void</span> create_back_edge(<a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp; G, <span class="keyword">const</span> <a class="code" href="a00010.html" title="An edge in a graph.">edge</a>&amp; org_edge);
<a name="l00285"></a>00285 
<a name="l00289"></a>00289     <span class="keywordtype">void</span> comp_max_flow(<span class="keyword">const</span> <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp; G);
<a name="l00290"></a>00290 
<a name="l00294"></a>00294     <span class="keywordtype">void</span> restore_graph(<a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp; G);
<a name="l00295"></a>00295 <span class="keyword">private</span>:
<a name="l00296"></a>00296 };
<a name="l00297"></a>00297 
<a name="l00298"></a>00298 __GTL_END_NAMESPACE
<a name="l00299"></a>00299 
<a name="l00300"></a>00300 <span class="preprocessor">#endif // GTL_MAXFLOW_PP_H</span>
<a name="l00301"></a>00301 <span class="preprocessor"></span>
<a name="l00302"></a>00302 <span class="comment">//--------------------------------------------------------------------------</span>
<a name="l00303"></a>00303 <span class="comment">//   end of file</span>
<a name="l00304"></a>00304 <span class="comment">//--------------------------------------------------------------------------</span>
</pre></div>    <p class="links">
      <a href="http://www.uni-passau.de/">University of Passau</a>
      &nbsp;-&nbsp;
      <a href="http://www.fmi.uni-passau.de/">FMI</a>
      &nbsp;-&nbsp;
      <a href="http://www.fmi.uni-passau.de/fmi/lehrstuehle/brandenburg/">Theoretical
	Computer Science</a>
    </p>
  <div class="copyright">
      Design &copy; 2002, 2003 <a href="mailto:raitner@fmi.uni-passau.de">Marcus Raitner</a>,  University of Passau 
  </div>
</body>
</html>
